home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / m68k / 6 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: ulkyvx.louisville.edu!gclind01
  2. From: gclind01@ulkyvx.louisville.edu
  3. Newsgroups: comp.sys.m68k
  4. Subject: Re: M68K asm beginner with a problem
  5. Date: 2 Jan 96 07:03:48 EDT
  6. Organization: University of Louisville
  7. Message-ID: <1996Jan2.070348.1@ulkyvx.louisville.edu>
  8. References: <30e88c51.9635879@nntp.ibmpcug.co.uk>
  9. NNTP-Posting-Host: ulkyvx.louisville.edu
  10.  
  11. In article <30e88c51.9635879@nntp.ibmpcug.co.uk>, simon@epsilon.win-uk.net (Simon Ho) writes:
  12. > Hi
  13. > I trying my hand at assembly language on the m68k cpu. I am trying to
  14. > program a small program to set up a list using dc.w command (for some
  15. > insert/delete routines later) but aren't quite sure how to implement
  16. > it.
  17. > To clarify, I have a list of values.  I want to set up an 'array'
  18. > with the value and  an address pointer to the next value. Ideally, I
  19. > would SECT this so that it can go in any available part of memory.
  20. > Do I have to set up loads of move.w commands?
  21. > Do I just 
  22. >     dc.w.  $200, 3, $202, 4, etc ?
  23. > or what?
  24. > This should allow me to program a routine to insert a value at the end
  25. > of the array but with the pointer of the next lowest number pointing
  26. > to that value and then have the pointer associated with that value
  27. > pooint to the next highest value.
  28.  
  29. Your problem is that you want to program in the links at assemble time,
  30. [B but you don't know
  31. the address the program is going to be loaded so you don't know what
  32. numbers to choose for the links.
  33.  
  34.  
  35. The easy way is, start with a link of 4 and use 8 for the next link and
  36. so on.  Then when the program is loaded and you figure out where the
  37. data is going to be you write a loop to fix all the links.  For example
  38. if the links come first and then the data:
  39.  
  40.  
  41. addr    dc.w    4,5,8,7,12,20,16,21,0,23
  42.  
  43. Here the 0 indicates there are no further links.  Then in the program
  44. you add 'addr' to each of the links at run-time (you can write it in
  45. a loop) and you are set to go  
  46. > TIA
  47. > Simon
  48. -- 
  49. David Lindauer                           - gclind01@ulkyvx.louisville.edu
  50.                                          - Theropod for 68K series
  51. ftp:  ftp.std.com://pub/os-code
  52.